/*
* DistroJSP.java
*
* Copyright (c) 2007 Aris Bartee
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* July 10, 2007
*/
package afterburner.distro;
import java.text.MessageFormat;
import afterburner.jsp.JSP;
import java.util.Date;
import afterburner.jsp.annotations.*;
 /**
 * 
 * @author arisbartee
 */
import afterburner.jsp.annotations.LayoutTemplate;
@LayoutTemplate("layout.jsp")
public class DistroJSP extends JSP {
	public String message = null;
	
	
	public void messageDisplay(){
		message = (String)_request.getSession().getAttribute("message");
	}
	
	@DefaultAction
	public void index(){
		 int planet = 7;
		 String event = "a disturbance in the Force";
		 String date = "date";
		String result = java.text.MessageFormat.format(
			     "At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.",
			     planet, new java.util.Date(), event);
		message = java.text.MessageFormat.format(
				"Today''s {0} is {1,date}.",
				date,new java.util.Date());
		//message = result;
	}
        
        @NoLayout
        public void message(){
            message = param("message");
            _request.getSession().setAttribute("message",message);
        }
}
